const { defineComponent, h } = require("vue");
const {useRouter} = require("vue-router")
const Navgations = defineComponent({
    data(){
        return{

        }
    },
    props:{
        title:{
            type:String,
            required:true
        },
        is_showlef:{
            type:Boolean,
            required:false
        },
        background:{
            type:String,
            required:false
        }
    },
    render(){
    const router = useRouter()
    const right = this.$slots.right
    const left = this.$slots.left
     return  h(
            // {String | Object | Function} tag
            'div' ,
            // {Object} props
            {
                style:{
                    width:'100vw',
                    height:'1.49rem',
                    fontSize:'0.48rem',
                    background:this.background?this.background:'#ffffff',
                    display:'flex',
                    alignItems:'center',
                    justifyContent:"center",
                    position: 'relative',
                }
            },
            // {String | Array | Object} children
            [
                this.is_showlef?h('div',{style:{}},left()):h('img',{
                    style:{width:'0.64rem',height:'0.64rem',position: 'absolute',left:'0.44rem'},
                    src:require('../../assets/imgs/resigter_back.png'),
                    onclick:$event =>router.go(-1)},null),
                this.title,
                h('div',{
                    style:{
                        position: 'absolute',
                        right:'0.41rem'
                    }
                },right?right():null),
            ]
        )
    }
})
export default Navgations